<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%--
  Created by IntelliJ IDEA.
  User: rty
  Date: 2025/8/22
  Time: 15:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<button id="btn1">点击获取数据</button>
<button id="btn2">点击获取userlist数据</button>
</body>
<script>
    document.getElementById("btn1").onclick=function (){
        var userDate={"name":"zhangsan","age":22}
        $.ajax({
            type:"POST",
            url:"/arg3",
            data:JSON.stringify(userDate),
            contentType:"application/json;charset=utf-8"
        });
    }

    document.getElementById("btn2").onclick=function (){
        var userList= new Array();
        userList.push({"name":"zhangsan","age":22})
        userList.push({"name":"lisi","age":33})
        $.ajax({
            type:"POST",
            url:"/arg5",
            data:JSON.stringify(userList),
            contentType:"application/json;charset=utf-8"
        });
    }


</script>
</html>
